﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Xiaov.SmartWeb.Application.loginXB.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>综合统计系统</title>
    <link rel="stylesheet" type="text/css" href="../Resources/easyui-1.32/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../Resources/easyui-1.32/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="../Resources/xiaovcn/css/main.css" />
    <script type="text/javascript" src="../Resources/easyui-1.32/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="../Resources/easyui-1.32/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../Resources/xiaovcn/scripts/common.js"></script>
    <script type="text/javascript">

        $(function () {
            //绑定左侧Tree
            $('#tt').tree({
                url: '/SysAdmin/Json/UserModule.aspx',
                lines: true,
                onClick: function (node) {
                    if (node.attributes.url != '#' && node.attributes.url != '') {  // alert node text property when clicked
                        add(node.attributes.url, node.text);
                    }
                }
            });
            add("/PluginSrc/StatisticalSystem/Manage/ReportStateList.aspx", "首页");
            var tabsId = 'main'; //tabs页签Id
            var tab_rightmenuId = 'tab_rightmenu'; //tabs右键菜单Id

            //绑定tabs的右键菜单
            $("#" + tabsId).tabs({
                onContextMenu: function (e, title) {//这时去掉 tabsId所在的div的这个属性：class="easyui-tabs"，否则会加载2次
                    e.preventDefault();
                    $('#' + tab_rightmenuId).menu('show', {
                        left: e.pageX,
                        top: e.pageY
                    }).data("tabTitle", title);
                }
            });

            //实例化menu的onClick事件
            $("#" + tab_rightmenuId).menu({
                onClick: function (item) {
                    CloseTab(tabsId, tab_rightmenuId, item.name);
                }
            });
        });

        var index = 0;
        function add(url, title) {
            if ($('#main').tabs('exists', title)) {
                if (confirm('已经打开了页面,是否关闭并重新加载该标签？\n警告：点击[确定]会关闭原有的标签页面并重新加载！！！如果你还没有保存过数据,请选【取消】！,')) {
                    //$('#tt').tabs('select', title);
                    $('#main').tabs('close', title);
                    $('#main').tabs('add', {
                        title: title,
                        content: "<iframe scrolling=\"no\" frameborder=\"0\" Src=\"" + url + "\" Style=\"width:100%;height:99%;\"></iframe>",
                        iconCls: 'icon-applicationgo',
                        closable: true
                    });
                }
                else {
                    $('#main').tabs('select', title);
                }
            } else {
                $('#main').tabs('add', {
                    title: title,
                    content: "<iframe scrolling=\"no\" frameborder=\"0\" Src=\"" + url + "\" Style=\"width:100%;height:99%;\"></iframe>",
                    iconCls: 'icon-applicationgo',
                    closable: true
                });
            }
        }

        function refresh() {
            var currTab = $('#main').tabs('getSelected'); //获得当前tab
            if (currTab) {
                var url = $(currTab.panel('options').content).attr('src');
                var title = currTab.panel('options').title;
                $('#main').tabs('close', title);
                add(url, title);
            }
        }


    </script>
</head>
<body class="easyui-layout">
    <form id="form1" runat="server">
    <div data-options="region:'north',border:false" style="height: 80px; padding: 0px;
        background-image: url(images/bg.jpg); background-repeat: repeat-x;
        overflow: hidden;">
        <div>
            <img src="images/logo.gif" /></div>
        <div style="text-align: right; position: absolute; top: 0px; right: 10px;">
            <ul id="shortcut">
                <li id="user-panel">
                    <img id="usr-avatar" src="images/top/hire-me.png" />
                    <div id="usr-info">
                        <p id="usr-name">
                            <%=this.PUser.USERNAME %></p>
                        <p id="usr-roles" title="">
                            <%=this.PUser.GetRolesDescriptByUserId(PUser.USERID) %></p>
                    </div>
                </li>
                <li><a href="#" title="首页" onclick="add('/PluginSrc/StatisticalSystem/Manage/ReportStateList.aspx','首页');">
                    <img src="images/top/home.png" /><span>首页</span></a></li>
                <li><a href="#" title="修改密码" onclick="add('/SysAdmin/Admin_Password.aspx','修改密码');">
                    <img src="images/top/lock.png" /><span>修改密码</span></a></li>
                <li><a href="#" title="信息版" onclick="add('/PluginSrc/GuestBook/SubjectList.aspx','信息版');">
                    <img src="images/top/comment.png" /><span>信息版</span><%--<div class="notification">10</div>--%></a></li>
                <li><a href="Logout.aspx" title="退出系统">
                    <img src="images/top/sign-out.png" /><span>退出系统</span></a></li>
            </ul>
        </div>
    </div>
    <div data-options="region:'west',split:true,title:'工具栏'" style="width: 300px; padding: 10px;">
        <ul id="tt">
        </ul>
    </div>
    <div data-options="region:'center'">
        <div id="main" class="easyui-tabs" style="width: 99%; height: auto; padding: 0px;"
            data-options="iconCls:'icon-save',collapsible:false,minimizable:false,maximizable:false,closable:false,tools:'#tab-tools'"
            fit="true" border="0">
            <!--工作区-->
        </div>
        <div id="tab-tools" style="border-top: none; border-right: none;">
            <a href="javascript:void(0)" class="easyui-linkbutton" plain="true" data-options="plain:true,iconCls:'icon-reload'"
                onclick="refresh()">刷新</a>
        </div>
        <%--右键菜单--%>
        <div id="tab_rightmenu" class="easyui-menu" style="width: 150px; display: none;">
            <!-- 	<div name="tab_menu-tabclose">关闭</div> -->
            <div name="tab_menu-tabcloseall">
                关闭全部标签</div>
            <div name="tab_menu-tabcloseother">
                关闭其他标签</div>
            <div class="menu-sep">
            </div>
            <div name="tab_menu-tabcloseright">
                关闭右侧标签</div>
            <div name="tab_menu-tabcloseleft">
                关闭左侧标签</div>
        </div>
    </div>
    <div data-options="region:'south',border:false" style="height: 30px; line-height: 30px;
        padding-left: 10px;">
        <span>华北工程公司综合统计系统 Version：<%=Xiaov.SmartWeb.Infrastructure.Config.WebAppConfig.AppVersion %>
            , Design By SmartWeb.Admin 森诺胜利工程有限公司</span> <span>1.00 Alpha. All rights reserved 2013</span>
    </div>
    </form>
</body>
</html>
